package com.cooper.mediadb.local;

import android.os.Bundle;

import com.cooper.mediadb.MediaBrowseBaseFragment;
import com.cooper.mediadb.MediaInfoDialog;
import com.cooper.slidingmenu.utils.SingleFragmentContain;

public class LocalMediaInfoDialog<T extends LocalMedia> extends
		MediaInfoDialog<T> {

	private T media;

	@Override
	public void onActivityCreated(Bundle savedState) {
		super.onActivityCreated(savedState);

		director.setText(getMedia().getDirector());
		plot.setText(getMedia().getPlot());
		setActorsText();
	}

	@SuppressWarnings("unchecked")
	@Override
	protected T getMedia() {
		if (media == null) {
			media = ((MediaBrowseBaseFragment<T>) ((SingleFragmentContain) getActivity())
					.getCurFragment()).getCurrentMedia();
		}
		return media;
	}

}
